package com.hhj.king.provider.ctrl;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author KING
 * @date 2018/10/9 20:27
 */
@RestController
public class HealthController {
    public static Boolean canVisitDb = true;

    @RequestMapping(value = "/db/{canVisitDb}")
    public String getDB(@PathVariable("canVisitDb") Boolean canVisitDb, HttpServletRequest req) {
        HealthController.canVisitDb = canVisitDb;
        return "数据连接状态:" + HealthController.canVisitDb;
    }
}
